package cn.com.dcsgo.controller;


import cn.com.dcsgo.model.sys.Region;
import cn.com.dcsgo.result.Result;
import cn.com.dcsgo.service.RegionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/*
前端接口查看前端文件：
uu-preferred-front-end/uuyx-admin/src/api/sys/region.js
*/

/**
 * <p>
 * 地区表 前端控制器
 * </p>
 *
 * @author Dcsgo
 * @since 2025-04-01
 */
@RestController
@Api(tags = "地区")
@RequiredArgsConstructor
@RequestMapping("admin/sys/region")
public class RegionController {
    private final RegionService regionService;

    @ApiOperation("根据关键字查询地区")
    @GetMapping("findRegionByKeyword/{keyword}")
    public Result<List<Region>> findRegionByKeyword(@PathVariable String keyword) {
        return Result.ok(regionService.findByKeyword(keyword));
    }
}

